<template>
<Modal v-model="modalEdit" fullscreen @on-cancel="handleModalEditCancel" 
@on-ok="handleModalEditOK" ok-text="提交">
	<template #header>
		<Icon custom="iconfont icon-Word"/>&nbsp;处罚审批表&nbsp;
	</template>
	<div><Row justify="center"><Col span="16">
		<Form ref="baseform" :model="baseform" :label-width="150">
		<Card title="案件情况" icon="ios-bookmark">
			<template #extra>
				{{baseform.party_name}}&nbsp;涉嫌&nbsp;{{baseform.cause_name}}
			</template>
			<FormItem label="具体违法事实" prop="facts">
				<Input v-model="baseform.facts" maxlength="300" show-word-limit type="textarea" :rows="5"/>
			</FormItem>
			<FormItem label="相关证据" prop="proof">
				<Input v-model="baseform.proof" maxlength="300" show-word-limit type="textarea" :rows="5"/>
			</FormItem>
			<FormItem label="履行告知及当事人陈述申辩或者听证情况" prop="explain">
				<Input v-model="baseform.explain" maxlength="300" show-word-limit type="textarea" :rows="5"/>
			</FormItem>
			<Alert show-icon>
				处罚（拆除）依据
				<template #desc>{{baseform.regulation_detail}} </template>
			</Alert>
		</Card>
		<br>
		<Card title="承办人意见" icon="ios-bookmark">
			<template #extra>
				提交日期：<DatePicker v-model="baseform.date1" type="date" placeholder="选择日期" style="width: 200px"></DatePicker>
			</template>
			<Input v-model="baseform.undertaker_opinion" maxlength="300" show-word-limit type="textarea" :rows="3"/>
		</Card>
		</Form>
	</Col></Row></div>
	<Spin size="large" fix :show="spinShow"></Spin>
</Modal>
</template>

<script>
import {dateUtils,appendDoc} from '@/libs/tools.js'
import config from '@/config'
export default{
	data(){
		return {
			modalEdit:true,
			spinShow: false,
			baseform:{}
		}
	},
	methods:{
		handleModalEditCancel(){
			this.$router.go(-1)
		},
		handleModalEditOK(){
			let data={...this.baseform}
			data.date1=dateUtils.format2(data.date1)
			data.undertaker_name=this.$store.state.user.userInfo.uid
			data.docs=appendDoc(data.docs,"doc209")
			this.spinShow=true
			this.$axios.post('mainCase1CreateDoc209.action',data).then(res=>{
				this.spinShow=false
				window.open(config.baseUrl+res.data,'_blank')
				this.$router.go(-1)
			})
			
		}
	},
	mounted(){
		this.$axios.post('mainCase1GetDoc209.action',{
			case_no:this.$route.query.case_no,
			party_type:this.$route.query.party_type
		}).then(res=>{
			this.baseform={...this.baseform,...res.data}
		})
	}
}
</script>

<style>
</style>